<?php
class Cts_Db_Compact extends Cts_Db_Table
{
    protected $_name = 'cts_compact' ;
    protected $_primary = 'id' ;
    
    public function getList( $strLocator , $nStart = NULL , $nLimit = NULL )
    {
        $this->_select = $this->_db->select();
    	$this->_select->limit ( $nLimit , $nStart ) ;
    	$this->_select->from( $this->_name, '*' )
    	              ->joinleft( 'cts_compact_type' , 'cts_compact.compact_type_id = cts_compact_type.id' , array( 'compact_type' => 'name' ) )
			          ->where( $strLocator )
    	              ->order( 'id asc' ) ;
        $sql = $this->_select->__toString( ) ;
        //echo $sql ;
        $result = $this->_db->fetchAll( $sql ) ;
        return $result ; 
    }
}